| Conditions | 2 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /* eslint-disable sort-keys */ |
||
| 11 | |||
| 12 | public createLogger(targets: LogTarget[], defaultMeta: Record<string, any>) { |
||
| 13 | this.logger = winston.createLogger({ |
||
| 14 | level: 'info', |
||
| 15 | format: winston.format.json(), |
||
| 16 | defaultMeta, |
||
| 17 | transports: [], |
||
| 18 | }); |
||
| 19 | |||
| 20 | if (targets.includes('file')) { |
||
| 21 | new winston.transports.File({ filename: `${__dirname}/codeboost.log` }); |
||
| 22 | } |
||
| 23 | |||
| 24 | //if (targets.includes('console')) { |
||
| 25 | this.logger.add(new winston.transports.Console({ format: winston.format.simple() })); |
||
| 26 | //} |
||
| 37 |